<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>学生管理</title>
</head>
<link rel="shortcut icon" href="../../static/favicon.ico"
      th:href="@{/static/favicon.ico}">
<link href="../../static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet"
      th:href="@{/static/css/bootstrap.min.css(v=3.3.6) }">
<link href="../../static/css/font-awesome.css?v=4.4.0" rel="stylesheet"
      th:href="@{/static/css/font-awesome.css(v=4.4.0) }">
<link href="../../static/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"
      th:href="@{/static/css/plugins/bootstrap-table/bootstrap-table.min.css }">
<link href="../../static/css/animate.css" rel="stylesheet"
      th:href="@{/static/css/animate.css }">
<link href="../../static/css/style.css?v=4.1.0" rel="stylesheet"
      th:href="@{/static/css/style.css(v=4.1.0) }">
<!--上传控件-->
<link href="../../static/public/user/bootstrap-fileinput/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css"
      th:href="@{/static/public/user/bootstrap-fileinput/css/fileinput.min.css}"/>
<link href="../../static/public/user/bootstrap-fileinput/themes/explorer/theme.css" media="all" rel="stylesheet" type="text/css"
      th:href="@{/static/public/user/bootstrap-fileinput/themes/explorer/theme.css}"/>
<!--树形控件-->
<link href="../../static/css/plugins/treeview/bootstrap-treeview.css" rel="stylesheet"
      th:href="@{/static/css/plugins/treeview/bootstrap-treeview.css }">
<!-- 弹出框插件 -->
<link href="../../static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet"
      th:href="@{/static/css/plugins/sweetalert/sweetalert.css }">
<!--时间控件-->
<link href="../../static/public/user/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"
      th:href="@{/static/public/user/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"
      rel="stylesheet">
<!--滑动按钮-->
<link href="../../static/css/plugins/switchery/switchery.css"
      th:href="@{/static/css/plugins/switchery/switchery.css}" rel="stylesheet">
<style type="text/css">
    .table > thead > tr > th    {
        color: #2a62bc;
    }
    .form-horizontal>.btn:not(.query){
        margin-left: 0.4%;
        float: right;
    }
</style>
<body class="gray-bg">
<!--表单-->
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox-title">
        <div class="row row-lg">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active" id="allStu"><a data-toggle="tab" href="#tab-1" aria-expanded="true">全部学生信息</a>
                        </li>
                        <li class="" id="notAllStu"><a data-toggle="tab"  href="#tab-2" aria-expanded="false">签约未分班学生信息</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane active">
                            <div class="panel-body">
                                <form class="form-horizontal"  id="stu_query">
                                    <div class="col-sm-2"> <div class="form-group">
                                            <label class=" control-label" style="float: left">
                                                班级:</label>
                                            <div class="col-sm-8" style="margin-left: -3%">
                                                <div class="input-group">
                                                    <input type="text" name="class" class="form-control" id="testNoBtn">
                                                    <div class="input-group-btn">
                                                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                                            <span class="caret"></span>
                                                        </button>
                                                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                                        </ul>
                                                    </div>
                                                    <!-- /btn-group -->
                                                </div>
                                            </div>
                                    </div></div>
                                    <div class="col-sm-2" style="margin-left: -4.6%"> <div class="form-group">
                                        <label class=" control-label" style="float: left">
                                            姓名:</label>
                                        <div class="col-sm-8" style="margin-left: -3%">
                                            <div class="input-group">
                                                <input type="text" class="form-control" id="testNoBtn2" name="name">
                                                <div class="input-group-btn">
                                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                                        <span class="caret"></span>
                                                    </button>
                                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                                    </ul>
                                                </div>
                                                <!-- /btn-group -->
                                            </div>
                                        </div>
                                    </div></div>
                                    <div class="col-sm-2" style="margin-left: -4.6%"> <div class="form-group">
                                        <label class=" control-label" style="float: left">
                                            学校:</label>
                                        <div class="col-sm-8" style="margin-left: -3%">
                                            <div class="input-group">
                                                <input type="text" class="form-control" id="testNoBtn3" name="school">
                                                <div class="input-group-btn">
                                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                                        <span class="caret"></span>
                                                    </button>
                                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                                    </ul>
                                                </div>
                                                <!-- /btn-group -->
                                            </div>
                                        </div>
                                    </div></div>
                                    <div class="col-sm-2" style="margin-left: -4.6%"> <div class="form-group">
                                        <label class=" control-label" style="float: left">
                                            学院:</label>
                                        <div class="col-sm-8" style="margin-left: -3%">
                                            <div class="input-group">
                                                <input type="text" class="form-control" id="testNoBtn4" name="college">
                                                <div class="input-group-btn">
                                                    <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                                        <span class="caret"></span>
                                                    </button>
                                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                                    </ul>
                                                </div>
                                                <!-- /btn-group -->
                                            </div>
                                        </div>
                                    </div></div>
                                    <div class="col-sm-3" style="margin-left: -4.6%"> <div class="form-group">
                                            <label class=" control-label" style="float: left">时间范围:</label>
                                            <div class="col-sm-9" style="margin-left: -1.2%">
                                                    <div class="input-group" >
                                                        <input type="text" class="form-control datepicker" name="start" />
                                                        <span class="input-group-addon">到</span>
                                                        <input type="text" class="form-control datepicker" name="end"  />
                                                    </div>
                                            </div>
                                            </div></div>
                                    <button  class="btn btn-success query" style="position:relative;margin-left: -2.6%;">查询</button>
                                    <button class="btn btn-danger deleteAll" type="button">删除</button>
                                    <button class="btn btn-info" type="button" data-toggle="modal" data-target="#modal_add">添加</button>
                                    <button class="btn btn-primary export" type="button">导出</button>
                                    <button class="btn btn-warning to_lead" type="button" data-toggle="modal" data-target="#modal_to_channel">导入</button>
                                </form>

                                <table id="tb_departments_1"></table>
                            </div>
                        </div>
                        <div id="tab-2" class="tab-pane">
                            <div class="panel-body" >
                                <div id="toolbar">
                                    <button type="button" class="btn btn-success" data-toggle="modal" data-target="#modal_allocation_2" >批量班级分配</button>
                                </div>
                                <table id="tb_departments_2"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--添加-->
<div class="modal  fade" id="modal_add" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">添加学生</h4>
            </div>
            <div class="modal-body">
                <form method="get" class="form-horizontal" id="form_add">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            姓名</label>
                        <div class="col-sm-8">
                            <input type="text" name="name" class="form-control" placeholder="请输入姓名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            手机</label>
                        <div class="col-sm-8">
                            <input type="text" name="phone" class="form-control" placeholder="请输入手机号">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            邮箱</label>
                        <div class="col-sm-8">
                            <input type="email" name="email" class="form-control" placeholder="请输入邮箱">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            密码</label>
                        <div class="col-sm-8">
                            <input type="password" name="password" class="form-control" placeholder="请输入密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            有效期</label>
                        <div class="col-sm-8">
                            <input type="text" name="lastLandingTime" class="form-control myData_add" placeholder="请输入截至日期">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否启用</label>
                        <div class="col-sm-6">
                            <input type="checkbox" name="startUsing" class="js-switch form-control"  />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            性别</label>
                        <div class="col-sm-8">
                            <label class="control-label">
                                <input type="radio" checked="checked" value="男" name="sex">
                                <span>男</span>
                            </label>&nbsp;&nbsp;

                            <label class="control-label">
                                <input type="radio" value="女" name="sex">
                                <span>女</span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            毕业院校</label>
                        <div class="col-sm-8">
                            <input type="text" name="school" disabled="" class="form-control " placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            省市区</label>
                        <div class="col-sm-8">
                            <input type="text" name="region" disabled="" class="form-control " placeholder="">
                        </div>
                    </div>

                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary add">保存</button>
            </div>
        </div>
    </div>
</div>
<!--编辑-->
<div class="modal  fade" id="modal_modification" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">修改</h4>
            </div>
            <div class="modal-body">
                <form method="get" class="form-horizontal" id="form_modification_1">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            学号</label>
                        <div class="col-sm-8">
                            <input type="text" name="stuId" disabled="" class="form-control" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            姓名</label>
                        <div class="col-sm-8">
                            <input type="text" name="name" class="form-control" placeholder="请输入姓名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            手机</label>
                        <div class="col-sm-8">
                            <input type="text" name="phone" class="form-control" placeholder="请输入手机号">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            邮箱</label>
                        <div class="col-sm-8">
                            <input type="email" name="email" class="form-control" placeholder="请输入邮箱">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            密码</label>
                        <div class="col-sm-8">
                            <input type="password" name="password" class="form-control" placeholder="请输入密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            有效期</label>
                        <div class="col-sm-8">
                            <input type="text" name="lastLandingTime" class="form-control myData_add" placeholder="请输入截至日期">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否启用</label>
                        <div class="col-sm-6">
                            <input type="checkbox" name="startUsing" class="js-switch form-control"  />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            性别</label>
                        <div class="col-sm-8">
                            <label class="control-label">
                                <input type="radio" checked="checked" value="男" name="sex">
                                <span>男</span>
                            </label>&nbsp;&nbsp;

                            <label class="control-label">
                                <input type="radio" value="女" name="sex">
                                <span>女</span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            毕业院校</label>
                        <div class="col-sm-8">
                            <input type="text" name="school" disabled="" class="form-control myData_add" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            省市区</label>
                        <div class="col-sm-8">
                            <input type="text" name="region" disabled="" class="form-control myData_add" placeholder="">
                        </div>
                    </div>

                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary modification_1">保存</button>
            </div>
        </div>
    </div>
</div>
<!--编辑-模块二-->
<div class="modal  fade" id="modal_modification_1" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">修改</h4>
            </div>
            <div class="modal-body">
                <form method="get" class="form-horizontal" id="form_modification_2">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            序号</label>
                        <div class="col-sm-8">
                            <input type="text" name="id" disabled="" class="form-control" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            姓名</label>
                        <div class="col-sm-8">
                            <input type="text" name="name" class="form-control" placeholder="请输入姓名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            性别</label>
                        <div class="col-sm-8">
                            <label class="control-label">
                                <input type="radio" checked="checked" value="男" name="sex">
                                <span>男</span>
                            </label>&nbsp;&nbsp;

                            <label class="control-label">
                                <input type="radio" value="女" name="sex">
                                <span>女</span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            手机</label>
                        <div class="col-sm-8">
                            <input type="text" name="phone" class="form-control" placeholder="请输入手机号">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            客户归属</label>
                        <div class="col-sm-8">
                            <input type="email" name="customerBelongs" class="form-control" placeholder="请输入客户归属">
                        </div>
                    </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary modification_2">保存</button>
            </div>
        </div>
    </div>
</div>
<!--分配班级-->
<div class="modal  fade" id="modal_allocation" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">分配班级</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="form_allocation_1">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            学生姓名</label>
                        <div class="col-sm-8">
                            <input type="text" name="name" disabled="" class="form-control" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-8">
                            <button type="button" class="btn btn-primary allocation">分配班级</button>
                            <button type="button" class="btn btn-default class_transfer">学生转班</button>
                        </div>
                    </div>
                    <div id="allocation">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                分配班级</label>
                            <div class="col-sm-8">
                                <div class="ibox-content">
                                <div class="treeview_allocation"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="class_transfer"  style="display:none;">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                所在班级</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <input type="text" name="class_start" class="form-control" id="testNoBtn6">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                        </ul>
                                    </div>
                                    <!-- /btn-group -->
                                </div>
                            </div>
                        </div>
                        <div class="form-group ">
                            <label class="col-sm-2 control-label">
                                转到班级</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <input type="text" name="class_end" class="form-control" id="testNoBtn7">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                        </ul>
                                    </div>
                                    <!-- /btn-group -->
                                </div>
                            </div>
                        </div>
                        <div class="form-group ">
                            <label class="col-sm-2 control-label">
                                相关描述</label>
                            <div class="col-sm-8">
                                <textarea  class="form-control" name="describe" rows="4"></textarea>
                                <!-- /btn-group -->
                            </div>
                        </div>
                    </div>


                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary allocation_1">保存</button>
            </div>
        </div>
    </div>
</div>
<!--分配班级-模块二-->
<div class="modal  fade" id="modal_allocation_1" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">分配班级</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="form_allocation_2">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            学生姓名</label>
                        <div class="col-sm-8">
                            <input type="text" name="name" disabled="" class="form-control" placeholder="">
                        </div>
                    </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                分配班级</label>
                            <div class="col-sm-8">
                                <div class="ibox-content">
                                <div class="treeview_allocation"></div>
                                </div>
                            </div>
                        </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary allocation_2">保存</button>
            </div>
        </div>
    </div>
</div>
<!--批量分配班级-模块二-->
<div class="modal  fade" id="modal_allocation_2" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">分配班级</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="form_allocation_3">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            分配班级</label>
                        <div class="col-sm-8">
                            <div class="ibox-content">
                            <div class="treeview_allocation"></div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary allocation_3">保存</button>
            </div>
        </div>
    </div>
</div>
<!--导入-->
<div class="modal  fade" id="modal_to_channel" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">批量导入</h4>
            </div>
            <div class="modal-body">
                <form method="get" class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            选择文件</label>
                        <div class="col-sm-8">
                            <input type="file" id="file" class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">
                            模板下载</label>
                        <div class="col-sm-8">
                            <button type="button" class="btn btn-white" title="点我下载xls模板">下载模板</button>
                        </div>
                    </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary">保存</button>
            </div>
        </div>
    </div>
</div>

</body>
<!-- 全局js -->
<script src="../../static/js/jquery.min.js?v=2.1.4"
        th:src="@{/static/js/jquery.min.js(v=2.1.4) }"></script>
<script src="../../static/js/bootstrap.min.js?v=3.3.6"
        th:src="@{/static/js/bootstrap.min.js(v=3.3.6) }"></script>
<!-- 自定义js -->
<script src="../../static/js/content.js?v=1.0.0"
        th:src="@{/static/js/content.js(v=1.0.0) }"></script>
<!-- Bootstrap table -->
<script src="../../static/js/plugins/bootstrap-table/bootstrap-table.min.js"
        th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table.min.js }"></script>
<script src="../../static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"
        th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js }"></script>
<script src="../../static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"
        th:src="@{/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js }"></script>
<!-- 树形控件 -->
<script src="../../static/js/plugins/treeview/bootstrap-treeview.min.js"
        th:src="@{/static/js/plugins/treeview/bootstrap-treeview.min.js}"></script>
<script src="../../static/public/user/treeCheckBox.js"
        th:src="@{/static/public/user/treeCheckBox.js }"></script>
<!--动态搜索-->
<script src="../../static/js/plugins/suggest/bootstrap-suggest.min.js"
        th:src="@{/static/js/plugins/suggest/bootstrap-suggest.min.js}"></script>
<script src="../../static/public/user/bsSuggest.js"
        th:src="@{/static/public/user/bsSuggest.js }"></script>
<!-- 弹出框插件 -->
<script src="../../static/js/plugins/sweetalert/sweetalert.min.js"
        th:src="@{/static/js/plugins/sweetalert/sweetalert.min.js }"></script>
<!-- 时间控件 -->
<script src="../../static/public/user/bootstrap-datetimepicker/bootstrap-datetimepicker.js"
        th:src="@{/static/public/user/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js}"></script>
<script src="../../static/public/user/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
        th:src="@{/static/public/user/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js}"></script>
<script src="../../static/public/user/timeAllocation.js"
        th:src="@{/static/public/user/timeAllocation.js }"></script>
<!--滑动按钮-->
<script src="../../static/js/plugins/switchery/switchery.js"
        th:src="@{/static/js/plugins/switchery/switchery.js}"></script>
<!-- 文件上传 -->
<script src="../../static/public/user/bootstrap-fileinput/js/fileinput.js" type="text/javascript"
        th:src="@{/static/public/user/bootstrap-fileinput/js/fileinput.js}"></script>
<script src="../../static/public/user/bootstrap-fileinput/js/plugins/sortable.js" type="text/javascript"
        th:src="@{/static/public/user/bootstrap-fileinput/js/plugins/sortable.js}"></script>
<script src="../../static/public/user/bootstrap-fileinput/themes/explorer/theme.js" type="text/javascript"
        th:src="@{/static/public/user/bootstrap-fileinput/themes/explorer/theme.js}"></script>
<script src="../../static/public/user/bootstrap-fileinput/js/locales/zh.js" type="text/javascript"
        th:src="@{/static/public/user/bootstrap-fileinput/js/locales/zh.js}"></script>
<!--自定义js---表格操作-->
<script src="../../static/public/exam/tableOperation.js"
        th:src="@{/static/public/exam/tableOperation.js}"></script>
<!--时间控制-->
<script>
    $(function () {
        /*时间控件配置*/
        let object = '.datepicker';
        let object1 = '.myData_add';
        timeAllocationForTime(object);
        timeAllocationForTime(object1);
    });
</script>
<!--滑动按钮大小控制-->
<script>
    //页面如何有多个互动按钮必须需要这些js代码
    var switchery;
    let elems =Array.prototype.slice.call($('.js-switch'));
    elems.forEach(function(html) {
        /* size: 'normal' 控制大小*/
        switchery = new Switchery(html);
        html.onchange = function () {
            alert(html.checked);
        }
    });
</script>
<!--树形控制-->
<script>
    $(function () {
        let $treevie = $('.treeview_allocation');
        let url = "../../static/js/demo/user/class_treeCheck_test.json";
        initCheckTree($treevie,url);
    });

</script>
<!--上传文件控制-->
<script>
    //初始化fileinput控件（第一次初始化）
    function initFileInput(ctrlName, uploadUrl) {
        var control = $('#' + ctrlName);
        control.fileinput({
            language: 'zh', //设置语言
            uploadUrl: uploadUrl, //上传的地址
            allowedFileExtensions : ['xls', 'xlsx'],//接收的文件后缀
            showUpload: true, //是否显示上传按钮
            showCaption: false,//是否显示标题
            browseClass: "btn btn-primary", //按钮样式
            textEncoding:'UTF-8',//编码格式
            uploadAsync: false, //默认异步上传
            showPreview :false, //是否显示预览
            maxFileCount:1, //表示允许同时上传的最大文件个数
            previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
        });
    }
    //初始化fileinput控件（第一次初始化）
    initFileInput("file", "../../static/js/demo/user/excel");
</script>
<!--表单数据-->
<script>
    $(function () {
        //1.初始化Table
        TableInit().Init();
        /*添加提交表单*/
        $('.add').click(function () {
            $('#form_add').submit();
        });
        /*修改提交表单*/
        $('.modification_1').click(function () {
            $('#form_modification_1').submit();
        });
        $('.modification_2').click(function () {
            $('#form_modification_2').submit();
        });

        /*分配角色*/
        $('.allocation_1').click(function () {
            $('#form_allocation_1').submit();
        });
        $('.allocation_2').click(function () {
            $('#form_allocation_2').submit();
        });
        $('.allocation_3').click(function () {
            $('#form_allocation_3').submit();
        });

        $('.deleteAll').click(function () {
            deleteAllRecords("",'#tb_departments_1')
        });


        $('.query').click(function () {
            let stu_class = $('form[id="stu_query"] input[name="class"]').val();
            let name = $('form[id="stu_query"] input[name="name"]').val();
            let school = $('form[id="stu_query"] input[name="school"]').val();
            let college = $('form[id="stu_query"] input[name="college"]').val();
            let start = $('form[id="stu_query"] input[name="start"]').val();
            let end = $('form[id="stu_query"] input[name="end"]').val();
            if (stu_class  == "" || name  == "" || school  == "" || college  == "" || start  == "" || end  == ""){
                swal("搜索失败！", "不允许有空数据", "error");
                return false;
            }
            let obj = {
                "class":stu_class,
                "name":name,
                "school":school,
                "college":college,
                "start":start,
                "end":end
            }
            let query_data = JSON.stringify(obj);
            alert(query_data);
            //发送ajax 查询
          /*  $.ajax({
                url: appName+"/book/deleteSelect.do",
                method: "post",
                async: true,
                data: query_data,
                dataType: "text",   //期望服务端返回的数据类型
                contentType: "application/json",
                success: function (data) {
                    console.log(data.toString());
                    //重新加载页面
                    $('#tb_departments_1').bootstrapTable('load', data);
                },
                error: function (jqXHR) {
                    swal("搜索失败！", "未知错误", "error");
                }
            });*/
            swal("搜索成功！", "已为你重新加载数据", "success");
        });

        /*导出按钮操作*/
        $('.export').click(function () {
           exportRecord("","学生信息")
        });
    });
    /**
     * 显示下拉按钮
     */
    let url = '../../static/js/demo/user/stuListTest.json';
    /*班级*/
    bsSuggest("#testNoBtn",url,"class");
    /*姓名*/
    bsSuggest("#testNoBtn2",url,"name");
    /*学校*/
    bsSuggest("#testNoBtn3",url,"school");
    /*学院*/
    bsSuggest("#testNoBtn4",url,"college");
   /*客服归属*/
    bsSuggest("#testNoBtn5",url,"customerBelongs");
    /*所在班级*/
    bsSuggest("#testNoBtn6",url,"class");
    /*转到班级*/
    bsSuggest("#testNoBtn7",url,"class");


    var TableInit = function () {
        var oTableInit = new Object();
        //初始化Table
        oTableInit.Init = function () {
            $('#tb_departments_1').bootstrapTable({
                url: '../../static/js/demo/user/adminListTest.json',       //请求后台的URL（*）
                // method: 'get',                      //请求方式（*）
                toolbar: '#toolbar',                //工具按钮用哪个容器
                striped: true,                      //是否显示行间隔色
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                pagination: true,                   //是否显示分页（*）
                sidePagination: "client",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber:1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                height: 500,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                uniqueId: "id",                     //每一行的唯一标识，一般为主键列
                onPostBody:switchInit,
                columns: [{
                    checkbox: true
                }, {
                    field: 'stuId',
                    title: '学号',
                    color : "red"
                }, {
                    field: 'name',
                    title: '姓名'
                }, {
                    field: 'sex',
                    title: '性别'
                }, {
                    field: 'phone',
                    title: '手机'
                }, {
                    field: 'email',
                    title: '邮箱'
                }, {
                    field: 'startUsing',
                    title: '有效状态',
                    formatter:addSlideChoiceBox,
                }, {
                    field: 'lastLandingTime',
                    title: '最后登陆时间'
                },{
                    field: 'operate',
                    title: '操作',
                    width: 150,
                    formatter: addFunctionAlty,//表格中增加按钮  
                    events:{
                        'click button[title=删除]':function (e,value,row,index) {
                          deleteRecord(e,value,row,index,"",'#tb_departments_1')
                        },
                        'click button[title=修改]':function (e,value,row,index) {
                            //回显数据
                            $('form[id="form_modification_1"] input[name="stuId"]').val(row.stuId);
                            $('form[id="form_modification_1"] input[name="userName"]').val(row.userName);
                            $('form[id="form_modification_1"] input[name="name"]').val(row.name);
                            let sex;
                            if(row.sex == '男'){
                                sex =  $('form[id="form_modification_1"] input[value=男]');
                            }else {
                                sex =  $('form[id="form_modification_1"] input[value=女]');
                            }  sex.prop("checked",true);
                            /*第二种遍历循环式的选中*/
                            /*         let sexs =  $('form[id="form_modification"] input[name="sex"]');
                                     for (let i=0;i<sexs.length;i++){
                                         if (row.sex == sexs[i].value){
                                             sexs[i].checked = true ;
                                             break;
                                         }
                                     }*/
                            $('form[id="form_modification_1"] input[name="phone"]').val(row.phone);
                            $('form[id="form_modification_1"] input[name="email"]').val(row.email);
                            $('form[id="form_modification_1"] input[name="lastLandingTime"]').val(row.lastLandingTime);
                            $('form[id="form_modification_1"] input[name="password"]').val(row.password);
                            $('form[id="form_modification_1"] input[name="major"]').val(row.major);
                            $('form[id="form_modification_1"] input[name="customerBelongs"]').val(row.customerBelongs);
                            let startUsing = $('form[id="form_modification_1"] input[name="startUsing"]');

                            if((row.startUsing == '启用' && !switchery.isChecked())||
                                (row.startUsing == '不启用' && switchery.isChecked())){
                                switchery.setPosition(true);
                                switchery.handleOnchange(true);
                            }

                            $('#modal_modification').modal();
                        },
                        'click button[title=分配班级]':function (e,value,row,index) {
                            //回显数据
                            $('form[id="form_allocation_1"] input[name="name"]').val(row.name);
                            $('#modal_allocation').modal();
                        },
                    }
                }]
            });
            $('#tb_departments_2').bootstrapTable({
                url: '../../static/js/demo/user/adminListTest.json',       //请求后台的URL（*）
                // method: 'get',                      //请求方式（*）
                toolbar: '#toolbar',                //工具按钮用哪个容器
                striped: true,                      //是否显示行间隔色
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                pagination: true,                   //是否显示分页（*）
                queryParams: oTableInit.queryParams,//传递参数（*）
                sidePagination: "client",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber:1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: true,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                showSearchButton: true,
                searchAlign:"left",
                toolbarAlign: "right",
                searchFields: "customerBelongs",
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                height: 500,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                uniqueId: "id",                     //每一行的唯一标识，一般为主键列
                columns: [{
                    checkbox: true
                }, {
                    field: 'serialNumber',
                    title: '序号'
                }, {
                    field: 'name',
                    title: '姓名'
                }, {
                    field: 'sex',
                    title: '性别'
                }, {
                    field: 'phone',
                    title: '手机'
                }, {
                    field: 'customerBelongs',
                    title: '客户归属'
                },{
                    field: 'operate',
                    title: '操作',
                    width: 150,
                    formatter: addFunctionAlty_1,//表格中增加按钮  
                    events:{
                        'click button[title=删除]':function (e,value,row,index) {
                            deleteRecord(e,value,row,index,"",'#tb_departments_2')
                        },
                        'click button[title=修改]':function (e,value,row,index) {
                            //回显数据
                            $('form[id="form_modification_2"] input[name="stuId"]').val(row.stuId);
                            $('form[id="form_modification_2"] input[name="id"]').val(row.id);
                            $('form[id="form_modification_2"] input[name="userName"]').val(row.userName);
                            $('form[id="form_modification_2"] input[name="name"]').val(row.name);
                            let sex;
                            if(row.sex == '男'){
                                sex =  $('form[id="form_modification_2"] input[value=男]');
                            }else {
                                sex =  $('form[id="form_modification_2"] input[value=女]');
                            }  sex.prop("checked",true);
                            /*第二种遍历循环式的选中*/
                            /*         let sexs =  $('form[id="form_modification"] input[name="sex"]');
                                     for (let i=0;i<sexs.length;i++){
                                         if (row.sex == sexs[i].value){
                                             sexs[i].checked = true ;
                                             break;
                                         }
                                     }*/
                            $('form[id="form_modification_2"] input[name="phone"]').val(row.phone);
                            $('form[id="form_modification_2"] input[name="email"]').val(row.email);
                            $('form[id="form_modification_2"] input[name="lastLandingTime"]').val(row.lastLandingTime);
                            $('form[id="form_modification_2"] input[name="password"]').val(row.password);
                            $('form[id="form_modification_2"] input[name="major"]').val(row.major);
                            $('form[id="form_modification_2"] input[name="serialNumber"]').val(row.serialNumber);
                            $('form[id="form_modification_2"] input[name="customerBelongs"]').val(row.customerBelongs);
                            let startUsing = $('form[id="form_modification_2"] input[name="startUsing"]');

                            if((row.startUsing == '启用' && !switchery.isChecked())||
                                (row.startUsing == '不启用' && switchery.isChecked())){
                                switchery.setPosition(true);
                                switchery.handleOnchange(true);
                            }

                            $('#modal_modification_1').modal();
                        },
                        'click button[title=分配班级]':function (e,value,row,index) {
                            //回显数据
                            $('form[id="form_allocation_2"] input[name="name"]').val(row.name);
                            $('#modal_allocation_1').modal();
                        },
                    }
                }]
            });
        };
        /*滑动按钮初始化*/
        let switchInit = function () {
            //页面如何有多个互动按钮必须需要这些js代码
            let elems =Array.prototype.slice.call($('.js-switch-1'));
            elems.forEach(function(html) {
                /* size: 'normal' 控制大小*/
                var switchery = new Switchery(html);
                html.onchange = function () {
                    alert(html.checked);
                }
            });
        }

        function addSlideChoiceBox(value, row, index) {
            if(value == '启用'){
                return ' <input type="checkbox" class="js-switch-1 form-control" checked/>'}
            if(value == '不启用'){
                return ' <input type="checkbox" class="js-switch-1 form-control"/>'}
        }

        function addFunctionAlty(value, row, index) {
            return '<button id = "+id+" type = "button" class = "btn btn-white" title="修改" ' +
                '> <i class="glyphicon glyphicon-edit"/> </button>' +
                '<button id = "+id+" type = "button" class = "btn btn-white" title="删除"> <i class="glyphicon glyphicon-trash text-danger"/> </button>'+
                '<button id = "+id+" type = "button" class = "btn btn-white" title="分配班级"' +
                ' > <i class="glyphicon glyphicon-share text-success"/> </button>'
                ;
        }
        function addFunctionAlty_1(value, row, index) {
            return '<button id = "+id+" type = "button" class = "btn btn-white" title="修改" ' +
                '> <i class="glyphicon glyphicon-edit"/> </button>' +
                '<button id = "+id+" type = "button" class = "btn btn-white" title="删除"> <i class="glyphicon glyphicon-trash text-danger"/> </button>'+
                '<button id = "+id+" type = "button" class = "btn btn-white" title="分配班级"' +
                '> <i class="glyphicon glyphicon-share text-success"/> </button>'
                ;
        }
        //得到查询的参数
        oTableInit.queryParams = function (params) {
            var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                limit: params.limit,   //页面大小
                offset: params.offset,  //页码
                departmentname: $("#txt_search_departmentname").val(),
                statu: $("#txt_search_statu").val()
            };
            return temp;
        };
        return oTableInit;
    };
</script>
<!--分配按钮切换-->
<script>
    $(function () {
        $('.allocation').click(function () {
            $('.class_transfer').attr("class","btn btn-default class_transfer");
            $('#class_transfer').css("display","none");
            $('.allocation').attr("class","btn btn-primary allocation");
            $('#allocation').css("display","");
        });
        $('.class_transfer').click(function () {
            $('.allocation').attr("class","btn btn-default allocation");
            $('#allocation').css("display","none");
            $('.class_transfer').attr("class","btn btn-primary class_transfer");
            $('#class_transfer').css("display","");
        });
    });
</script>
</html>